# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Recommender.V1beta1.Model.GoogleCloudRecommenderV1beta1CostProjection do
  @moduledoc """
  Contains metadata about how much money a recommendation can save or incur.

  ## Attributes

  *   `cost` (*type:* `GoogleApi.Recommender.V1beta1.Model.GoogleTypeMoney.t`, *default:* `nil`) - An approximate projection on amount saved or amount incurred. Negative cost units indicate cost savings and positive cost units indicate increase. See google.type.Money documentation for positive/negative units. A user's permissions may affect whether the cost is computed using list prices or custom contract prices.
  *   `costInLocalCurrency` (*type:* `GoogleApi.Recommender.V1beta1.Model.GoogleTypeMoney.t`, *default:* `nil`) - The approximate cost savings in the billing account's local currency.
  *   `duration` (*type:* `String.t`, *default:* `nil`) - Duration for which this cost applies.
  *   `pricingType` (*type:* `String.t`, *default:* `nil`) - How the cost is calculated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cost => GoogleApi.Recommender.V1beta1.Model.GoogleTypeMoney.t() | nil,
          :costInLocalCurrency => GoogleApi.Recommender.V1beta1.Model.GoogleTypeMoney.t() | nil,
          :duration => String.t() | nil,
          :pricingType => String.t() | nil
        }

  field(:cost, as: GoogleApi.Recommender.V1beta1.Model.GoogleTypeMoney)
  field(:costInLocalCurrency, as: GoogleApi.Recommender.V1beta1.Model.GoogleTypeMoney)
  field(:duration)
  field(:pricingType)
end

defimpl Poison.Decoder,
  for: GoogleApi.Recommender.V1beta1.Model.GoogleCloudRecommenderV1beta1CostProjection do
  def decode(value, options) do
    GoogleApi.Recommender.V1beta1.Model.GoogleCloudRecommenderV1beta1CostProjection.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Recommender.V1beta1.Model.GoogleCloudRecommenderV1beta1CostProjection do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
